/*
 * @Author: yuluoY 2120942398@qq.com
 * @Date: 2024-10-28 20:53:43
 * @LastEditors: yuluoY 2120942398@qq.com
 * @LastEditTime: 2024-10-31 20:55:58
 * @FilePath: \Projecte:\gitee\GD32F427\gd32-f427\App\inc\app_led.h
 * @Description: 
 * 
 * Copyright (c) 2024 by ${YuluoY}, All Rights Reserved. 
 */

#ifndef APP_LED_H
#define APP_LED_H

extern led_info_t led_R_info;
extern led_info_t led_G_info;

extern led_ctrl_t LED_RED;
extern led_ctrl_t LED_GREEN;

#define LED_OPEN 0xFF
#define LED_BLINK_TIMES(x)	(x)
#define LED_CLOSE 0X00

#define LED_ON  0
#define LED_OFF 1

void app_led_create(void);
bool led_set_level(led_info_t *led_info, led_ctrl_t *led_ctrl, bool new_level);
void led_set(led_info_t *led_info, led_ctrl_t *led_ctrl, bool new_level);
bool led_toggle_level(led_info_t *led_info, led_ctrl_t *led_ctrl);
void led_set_param(led_info_t *led_info, led_ctrl_t *led_ctrl, uint8_t led_flag, uint16_t ontime, uint16_t offtime, uint8_t frequency);
void led_control_function(led_info_t *led_info, led_ctrl_t *led_ctrl);
void led_blink_function(led_info_t *led_info, led_ctrl_t *led_ctrl, uint8_t freq);

void led_task(void);

#endif // !APP_LED_H
